// locations to search for config files that get merged into the main config
// config files can either be Java properties files or ConfigSlurper scripts

// grails.config.locations = [ "classpath:${appName}-config.properties",
//                             "classpath:${appName}-config.groovy",
//                             "file:${userHome}/.grails/${appName}-config.properties",
//                             "file:${userHome}/.grails/${appName}-config.groovy"]

// if(System.properties["${appName}.config.location"]) {
//    grails.config.locations << "file:" + System.properties["${appName}.config.location"]
// }

grails.project.groupId = appName // change this to alter the default package name and Maven publishing destination
grails.mime.file.extensions = true // enables the parsing of file extensions from URLs into the request format
grails.mime.use.accept.header = false
grails.mime.types = [ html: ['text/html','application/xhtml+xml'],
                      xml: ['text/xml', 'application/xml'],
                      text: 'text/plain',
                      js: 'text/javascript',
                      rss: 'application/rss+xml',
                      atom: 'application/atom+xml',
                      css: 'text/css',
                      csv: 'text/csv',
                      all: '*/*',
                      json: ['application/json','text/json'],
                      form: 'application/x-www-form-urlencoded',
                      multipartForm: 'multipart/form-data'
                    ]

// URL Mapping Cache Max Size, defaults to 5000
//grails.urlmapping.cache.maxsize = 1000

// The default codec used to encode data with ${}
grails.views.default.codec = "none" // none, html, base64
grails.views.gsp.encoding = "UTF-8"
grails.converters.encoding = "UTF-8"
// enable Sitemesh preprocessing of GSP pages
grails.views.gsp.sitemesh.preprocess = true
grails.gsp.reload.enable = true
// scaffolding templates configuration
grails.scaffolding.templates.domainSuffix = 'Instance'

// Set to false to use the new Grails 1.2 JSONBuilder in the render method
grails.json.legacy.builder = false
// enabled native2ascii conversion of i18n properties files
grails.enable.native2ascii = true
// whether to install the java.util.logging bridge for sl4j. Disable for AppEngine!
grails.logging.jul.usebridge = true
// packages to include in Spring bean scanning
grails.spring.bean.packages = []

// request parameters to mask when logging exceptions
grails.exceptionresolver.params.exclude = ['password']

// set per-environment serverURL stem for creating absolute links
environments {
    production {
        grails.serverURL = "http://www.changeme.com"
		// Whether show "Role" and "Privilege" menu item.
		modules.menu.role.show = false
		modules.menu.privilege.show = false
		// Module "Install' config
		modules.install.needInitDemoData = false
		modules.install.needInitTestData = false
		modules.install.needInitAllData = false
		modules.install.needClearAllData = false
    }
    development {
        grails.serverURL = "http://localhost:8080/${appName}"
		modules.menu.role.show = true
		modules.menu.privilege.show = true
		modules.install.needInitDemoData = true
		modules.install.needInitTestData = true
		modules.install.needInitAllData = true
		modules.install.needClearAllData = true
    }
    test {
        grails.serverURL = "http://localhost:8080/${appName}"
    }
}

grails.resources.debug = true

// Module's configuration
modules {
	menu{
		// Whether show "Role" menu item.
		role.show = true
		// Whether show "Privilge" menu item.
		privilege.show = true
	}
	user{
		// Default super power user name.
		root.name = "admin"
	}
	role{
		// Default super power role name
		root.name = "Admin"
	}
}

// Default super power user name.
modules.user.root.name = "admin"
// Default super power role name
modules.role.root.name = "Admin"


// log4j configuration
log4j = {
	environments {
	    production {
		    appenders {
		        console name:'stdout', layout:pattern(conversionPattern: '%d{HH:mm:ss} %5p - %m%n')
		        file name:'server_log', file:'log/xt_server.log', layout:pattern(conversionPattern: '%d{MM-dd HH:mm:ss} %5p [%8.8t] - %m%n')
		        file name:'db_log', file:'log/db.log', layout:pattern(conversionPattern: '%d{MM-dd HH:mm:ss} %5p - %m%n')
		    }
			
			error  'org.codehaus.groovy.grails.web.servlet',  //  controllers
				   'org.codehaus.groovy.grails.web.pages', //  GSP
				   'org.codehaus.groovy.grails.web.sitemesh', //  layouts
				   'org.codehaus.groovy.grails.web.mapping.filter', // URL mapping
				   'org.codehaus.groovy.grails.web.mapping', // URL mapping
				   'org.codehaus.groovy.grails.commons', // core / classloading
				   'org.codehaus.groovy.grails.plugins', // plugins
				   'org.codehaus.groovy.grails.orm.hibernate', // hibernate integration
				   'org.springframework',
				   'org.hibernate',
				   'net.sf.ehcache.hibernate'

			warn   'org.mortbay.log'
	    }
		
		development {
		    appenders {
		        console name:'stdout', layout:pattern(conversionPattern: '%d{HH:mm:ss} %5p %15.15c{1} - %m%n')
		        file name:'server_log', file:'log/xt_server.log', layout:pattern(conversionPattern: '%d{MM-dd HH:mm:ss} %5p %20.20c{1}:%4L [%8.8t] - %m%n')
		        file name:'db_log', file:'log/db.log', layout:pattern(conversionPattern: '%d{MM-dd HH:mm:ss} %5p %c{1}:%L - %m%n')
		    }
			warn	stdout:['org.mortbay.log']
		    error	db_log:['org.hibernate'],
					stdout:['org.codehaus.groovy.grails.web.servlet',  //  controllers
						'org.codehaus.groovy.grails.web.pages', //  GSP
						'org.codehaus.groovy.grails.web.sitemesh', //  layouts
						'org.codehaus.groovy.grails.web.mapping.filter', // URL mapping
						'org.codehaus.groovy.grails.web.mapping', // URL mapping
						'org.codehaus.groovy.grails.commons', // core / classloading
						'org.codehaus.groovy.grails.plugins', // plugins
						'org.codehaus.groovy.grails.orm.hibernate', // hibernate integration
						'org.springframework',
						'org.apache.commons.configuration']
		}
	}
}


ldap {
		directories {
				directory1 {
				url = "ldap://example.com"
				base = "ou=example,dc=com"
				userDn = "uid=someuser,ou=example,dc=com"
				password = "password"
				searchControls {
						countLimit = 40
						timeLimit = 600
						searchScope = "subtree"
				}
				}
		}
		typemappings = [ my.app.MyTypeMappings ]
}
